<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BootCDN</title>
    <link rel="stylesheet" href="BS_exercice.css">
    <script src="register_0/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="headback">
    <div>
        <a href="http://localhost:63342/second/web%E5%BC%80%E5%8F%91/BS_exercice.html?_ijt=ogrqv3dc247r5suhq58qiv0u7o"><img
                src="ico_1.png" id="id1"></a>
        <a href="https://www.bootcdn.cn/api/" id="id2">API</a><a href="https://blog.bootcdn.cn/" id="id3">博客</a><a
            href="https://www.bootcdn.cn/#about" id="id4">关于</a>
    </div>
    <div id="head">
        <h1>BootCDN</h1>
    </div>
    <div id="head2">
        <h2>稳定、快速、免费的前端开源项目CSN加速服务</h2>
    </div>
    <div id="head3">
        <h3>共收录了3382个前端开源项目</h3>
    </div>
    <div id="head5">
        <div id="head4">
            <div><input id="input1" type="text" placeholder="搜索开源库，例如：jQuery" onblur="errimg()"><img id="img"
                                                                                                     src="QQ截图20180723203518.png"
                                                                                                     onclick="del()"
                                                                                                     onchange="cover()">
            </div>
        </div>
    </div>
</div>
<div id="logo">
    <a href="https://www.bootcdn.cn/bootstrap/"><img src="pic_BSexer/QQ截图20180724191140.png" id="img1"></a>
    <a href="https://www.bootcdn.cn/react/"><img src="pic_BSexer/QQ截图20180724191204.png" id="img2"></a>
    <a href="https://www.bootcdn.cn/jquery/"><img src="pic_BSexer/QQ截图20180724195536.png" id="img3"></a>
    <a href="https://www.bootcdn.cn/angular.js/"><img src="pic_BSexer/QQ截图20180724195602.png" id="img4"></a>
    <a href="https://www.bootcdn.cn/vue/"><img src="pic_BSexer/QQ截图20180724191303.png" id="img5"></a>
    <a href="https://www.bootcdn.cn/backbone.js/"><img src="pic_BSexer/QQ截图20180724191312.png" id="img6"></a>
    <a href="https://www.bootcdn.cn/lodash.js/"><img src="pic_BSexer/QQ截图20180724191322.png" id="img7"></a>
    <a href="https://www.bootcdn.cn/moment.js/"><img src="pic_BSexer/QQ截图20180724191356.png" id="img8"></a>
</div>
</body>
</html>
<script>
    function errimg() {
        var temp = $('#input1').val();
        if (temp.length === 0)
            document.getElementById('img').src = 'QQ截图20180723203518.png';
        else
            document.getElementById('img').src = 'QQ截图20180724091948.png'
    }
    function del() {
        if (document.getElementById('img').src = 'QQ截图20180724091948.png')
            document.getElementById('input1').value = "";
        else
            document.getElementById('img').src = 'QQ截图20180723203518.png'
    }
    function cover() {
//        var temp = $('#input1').val();
        if (document.getElementById('input1').value = "")
            document.getElementById('img').src = 'QQ截图20180723203518.png'
    }
</script>
